package cn.edu.zut.cs.Business;


import cn.edu.zut.cs.Dao.FirendsMapper;
import cn.edu.zut.cs.Model.Firends;
import cn.edu.zut.cs.Model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FirendsServiceImpl implements FirendsService{
    @Autowired
    FirendsMapper firendsMapper;

    @Override
    public List<String> listFriends(String username) {
        return firendsMapper.listFriends(username);
    }

    public void setFirendsMapper(FirendsMapper firendsMapper) {
        this.firendsMapper = firendsMapper;
    }

    @Override
    public List<User> findByleftnamelists(String left_name) {
        return firendsMapper.findByleftnamelists(left_name);
    }

    @Override
    public Firends findByleftname(String left_name, String right_name) {
        return firendsMapper.findByleftname(left_name,right_name);
    }

    @Override
    public int deletefriend(String left_name,String right_name) {
        return firendsMapper.deletefriend(left_name,right_name);
    }

    @Override
    public int insertfriend(String left_name, String right_name) {
        return firendsMapper.insertfriend(left_name,right_name);
    }
}
